package com.appbee.cm.client.regionunit.presenter;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Singleton;

@Singleton
public class StyleRegistry
{
	private final List<StyleInfo> styles = new ArrayList<StyleInfo>();

	public void register(String style, String id, String name)
	{
		styles.add(new StyleInfo(id, name, style));
	}

	public List<StyleInfo> getStyles()
	{
		return styles;
	}

	public StyleInfo getById(String styleId)
	{
		for (StyleInfo wrap : styles)
		{
			if (wrap.getId().equals(styleId))
				return wrap;
		}
		return styles.get(0);
	}

}
